<template>
  <div>
    <div class="lycontainer" v-if="!is_h5s">
      <el-scrollbar>
        <div class="lycontainerBoxs">
          <div v-if="authority([1])">
            <!-- v-if="authority([3])" -->
            <p class="indextitles">
              <el-text type="info">超管</el-text>
            </p>
            <ly-growcard-one
              :loading="showloading"
              :rows="2"
              v-model="growDataSuperAdmin"
              :countDatas="countDatas"
            ></ly-growcard-one>
          </div>
          <!-- growDataSuperAdmin -->
          <!-- <h3 class="lycontainerBoxs_h3">数据概览</h3> -->
          <div v-if="authority([2])">
            <!-- v-if="authority([3])" -->
            <p class="indextitles">
              <el-text type="info">在地区域数据</el-text>
            </p>

            <ly-growcard-one
              :loading="showloading"
              :rows="2"
              v-model="growData"
              :countDatas="countDatas"
            ></ly-growcard-one>
          </div>
          <div v-if="authority([3])">
            <p class="indextitles">
              <el-text type="info">线上区域数据</el-text>
            </p>

            <ly-growcard-one
              :loading="showloading"
              :rows="2"
              v-model="growDatazxqy"
              :countDatas="countDatas"
            ></ly-growcard-one>
          </div>
          <div v-if="authority([4])">
            <p class="indextitles">
              <el-text type="info">在地工作数据</el-text>
            </p>

            <ly-growcard-one
              :loading="showloading"
              :rows="2"
              v-model="growDatazdgz"
              :countDatas="countDatas"
            ></ly-growcard-one>
          </div>
          <div v-if="authority([5])">
            <p class="indextitles">
              <el-text type="info">线上工作数据</el-text>
            </p>

            <ly-growcard-one
              :loading="showloading"
              :rows="2"
              :countDatas="countDatas"
              v-model="growDataxsgz"
            ></ly-growcard-one>
          </div>
          <!-- <div> 
          <p class="indextitles">
            <el-text type="info">排课 & 开课概览</el-text>
          </p>
          <ly-growcard-one
            :loading="showloading"
            :rows="2"
            v-model="growData"
          ></ly-growcard-one>
        </div> -->
        </div>
        <!-- <div class="echarts-inner">
        <div class="lycontainerBoxs lycontainerBoxs2"> 
          <h3 class="lycontainerBoxs_h3">常用工具</h3>
          <div>
            <ly-growcard-twos
              :loading="showloading"
              :rows="2"
              v-model="growDataTwos"
            ></ly-growcard-twos>
          </div>
        </div>
      </div> -->
        <div style="width: 100%; overflow: hidden">
          <bootomViewVue></bootomViewVue>
        </div>
      </el-scrollbar>
    </div>
    <div v-if="is_h5s" class="h5_boxs_h5s">
      <img src="@/assets/img/zhiwu.png" class="h5imgbj" alt="" />
      <navconH5 :leftShow="false" texts="首页" />
      <div
        class="h5_boxs_h5sBoxse"
        ref="scrollContainer"
        @scroll="handleScroll"
      >
        <div class="h5Boxs_one">
          <h2>Hello,{{ info.username }}</h2>
          <p>欢迎使用支教执行管理</p>
        </div>
        <div class="h5Boxs_twos">
          <div class="container" v-if="authority([1,2,3,4])">
            <div class="item" @click="torouts('SchoolListTab',{id:1})">
              <div class="item1">学校总数</div>
              <div class="item2">{{countDatas['school']||0}}</div>
            </div>
            <div class="item" @click="torouts('SchoolListTab',{id:1})">
              <div class="item1">班级总数</div>
              <div class="item2">{{countDatas['schoolclass_num']||0}}</div>
            </div>
            <div class="item"  @click="torouts('SchoolListTab',{id:1,is_status:2})">
              <div class="item1"> {{ authority([1])?'正常开课学校':'已开课学校' }} </div>
              <div class="item2" v-if="authority([2,3,4])">{{ countDatas['schoolcountisstatus']||0}}</div>
              <div class="item2" v-if="authority([1])">{{ countDatas['schoolclasssmum']||0}}</div>

            </div>
            <!-- 添加更多项目以测试布局 -->
          </div>
          <div class="container" v-if="authority([5])">
            <div class="item" @click="torouts('SchoolListTab',{id:12,is_daike:1,class_session_status:'1'})">
              <div class="item1">完成督课次数</div>
              <div class="item2">{{countDatas['h5_class_session_status']||0}}</div>
            </div>
            <div class="item" @click="torouts('SchoolListTab',{id:14,is_daike:2,class_session_status:'1'})">
              <div class="item1">完成代课次数</div>
              <div class="item2">{{countDatas['h5_is_daike_status']||0}}</div>
            </div>
            <div class="item" @click="torouts('SchoolListTab',{id:12,class_session_status:'1'})">
              <div class="item1">总课节数</div>
              <div class="item2">{{countDatas['h5_is_daike_end']||0}}</div>
            </div>
            <!-- 添加更多项目以测试布局 -->
          </div>
        </div>
        <div class="h5Boxs_threes_list">
          <h2 @click="is_day_sor=true">{{jtday===dayjs().format("YYYY-MM-DD")?'今日数据':dayjs(jtday).format("YYYY年MM月DD日")+'数据'}}  <el-icon style="margin-left: 5px;"><CaretBottom /></el-icon></h2>
          <div class="h5Boxs_threes_lists_ones"  >
            <div class="lists_ones_item" @click="torouts('SchoolListTab',{id:authority([2,4])?10: 9,calss_time:dayjss(new Date(),'YYYY-MM-DD') })">
              <h3>{{countDatas['todaycount']||0}}</h3>
              <p>总计课节（次）</p>
            </div>
            <div class="lists_ones_item" @click="torouts('SchoolListTab',{id:authority([2,4])?10: 9,is_pause:2,calss_time:dayjss(new Date(),'YYYY-MM-DD') })"> 
              <h3>{{countDatas['todaystop']||0}}</h3>
              <p>暂停课节（次）</p>
            </div>
            <div class="lists_ones_item"  @click="torouts('SchoolListTab',{id:authority([2,4])?10: 9,class_session_status:1,is_daike:1,calss_time:dayjss(new Date(),'YYYY-MM-DD') })">
              <h3>{{countDatas['todaystart']||0}}</h3>
              <p>未代课节（次）</p>
            </div>
          </div>
          <!-- <div class="h5Boxs_threes_lists_ones"  v-if="authority([1,2,3])">
            <div class="lists_ones_item" @click="torouts('SchoolListTab',{id:authority([2,4])?10: 9,is_pause:1,class_session_status:1,is_daike:1})">
              <h3>{{countDatas['schoolclass_session_status']||0}}</h3>
              <p>正常课节（次）</p>
            </div>
            <div class="lists_ones_item" @click="torouts('SchoolListTab',{id:authority([2,4])?10: 9,is_daike:2})"> 
              <h3>{{countDatas['schoolclass_daike']||0}}</h3>
              <p>代课课节（次）</p>
            </div>
            <div class="lists_ones_item"  @click="torouts('SchoolListTab',{id:authority([2,4])?10: 9,class_session_status:1})">
              <h3>{{countDatas['schoolclassstatus']||0}}</h3>
              <p>已开课班级</p>
            </div>
          </div> -->
          <!-- <div class="h5Boxs_threes_lists_ones"  v-if="authority([4,5])" :class="authority([5])?'threes_lists_ones2':''">
            <div class="lists_ones_item" v-if="authority([4])" @click="torouts('SchoolListTab',{id:authority([2,4])?10: 9,class_session_status:1})">
              <h3>{{countDatas['schoolclassstatus']||0}}</h3>
              <p>开课班级总数</p>
            </div>
            <div class="lists_ones_item" @click="torouts('SchoolListTab',{id:authority([2,4])?11: 12})">
              <h3>{{countDatas['schoolclass_week']||0}}</h3>
              <p>本周课程总数</p>
            </div>
            <div class="lists_ones_item" v-if="authority([5])" @click="torouts('SchoolListTab',{id:authority([2,4])?11: 12,is_daike:2})">
              <h3>{{countDatas['schoolclass_weekpause']||0}}</h3>
              <p>代课课节（次）</p>
            </div>
            <div class="lists_ones_item"  v-if="authority([4])" @click="torouts('SchoolListTab',{id:6})">
              <h3>{{countDatas['schooltatus']||0}}</h3>
              <p>本周入校总数</p>
            </div>
          </div> -->
        </div>
        <el-affix :offset="9" @change="affixcheang">
          <div class="tabsJ_list_boxs" :class="is_affix ? 'tabsJ_affix' : ''">
            <div class="tabsJ_list_one">
              <div
                class="tabsJ_list_one_item"
                :class="is_shools_tab ? 'one_item_2' : ''"
                @click="shool_tabs(true)"
              >
                <div>班级信息</div>
                <p></p>
              </div>
              <div
                class="tabsJ_list_one_item tabsJ_list_one_item_sies"
                :class="!is_shools_tab ? 'one_item_2' : ''"
                @click="shool_tabs(false)"
              >
                <div>督课信息</div>
                <p></p>
              </div>
            </div>
            <div class="tabs_icons" @click="tabSeleShow">
              <el-icon><Filter /></el-icon>
              <span>筛选</span>
            </div>
          </div>
        </el-affix>

        <div>
          <div
            v-for="(item, index) in tableData"
            :key="index"
            class="tabslistsClass"
          >
            <div class="lists_item_boxs_one" v-if="is_shools_tab">
              <div>{{ dayjss(item.num_time, "MM") }}月</div>
              <p>{{ dayjss(item.num_time, "DD") }}</p>
            </div>
            <div class="lists_item_boxs_one" v-else>
              <div>{{ dayjss(item.calss_time, "MM") }}月</div>
              <p>{{ dayjss(item.calss_time, "DD") }}</p>
            </div>
            <div class="lists_item_boxs" style="max-width: calc(100% - 50px)">
              <showView v-if="is_shools_tab" :is_home="true" :listobjs="item" />
              <onlineView v-else :is_home="true" :listobjs="item" />
            </div>
          </div>
          <div v-if="isLoading" class="loading-text">加载中...</div>
          <div v-if="isEnd" class="loading-text">没有更多数据了</div>
          <el-empty description="暂无数据" v-if="!tableData.length&&!isEnd&&!isLoading" />
        </div>
      </div>
      <screenOut ref="screenOutTab" @oktabs="shool_tabs_sele(true)"/>
       <t-popup
                v-model="is_day_sor"
                placement="bottom"
                :close-on-overlay-click="true"
                :show-overlay="true"
              >
                <t-date-time-picker
                  @cancel="visiblehide"
                  @confirm="receptionData"
                  :value="jtday|| dayjs().format('YYYY-MM-DD')"
                  :end="dayjs().format('YYYY-MM-DD')"
                  :mode="['date']"
                  title="选择日期"
                  format="YYYY-MM-DD"
                />
              </t-popup>
    </div>
  </div>
</template>

<script>
import LyGrowcardOne from "@/components/analysis/growCardOne.vue";
import LyGrowcardTwos from "@/components/analysis/growCardTwos.vue";
import { setStorage, getStorage } from "@/utils/util";
import shoolListVue from "@/components/shoolList.vue";
import navconH5 from "@/components/navconH5.vue";
import showView from "@/components/h5com/shoolView.vue";
import onlineView from "@/components/h5com/onlineView.vue";
import LyEchartcard from "@/components/analysis/echartCard.vue";
import bootomViewVue from "@/components/bootomView/bootomView.vue";
import { homecount, schoolList, timetableList,caicount } from "@/api/api";
import screenOut from "@/components/h5com/screenOut.vue";
import dayjs from "dayjs";
export default {
  name: "analysis",
  components: {
    navconH5,
    LyEchartcard,
    LyGrowcardOne,
    LyGrowcardTwos,
    bootomViewVue,
    shoolListVue,
    showView,
    onlineView,
    screenOut,
  },
  data() {
    return {
      tearArr: [],
      jtday:dayjs().format("YYYY-MM-DD"),  //当天数据时间
      info: {},
      isEnd: false,
      dayjs:dayjs,
      is_day_sor:false,//当天数据筛选
      tableData:[],
      isLoading: false, // 防止重复加载
      formInline: { page: 1, per_page: 10 }, //数据参数
      Twostab: { page: 1, per_page: 10, total: 0 }, //原始数据参数
      is_affix: false,
      showloading: true,
      is_h5s: false, //是否h5模式
      is_shools_tab: true, //是否班级信息
      // 在地区域负责人
      growData: [
        {
          id: 1,
          title: "管理在地工作人员个数",
          nums: 245,
          count_key: "zdguser",
          tourl:'localManagement',//路由地址
          query:{},//携带参数
        },
        {
          id: 5,
          title: "负责区域本学期学校总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "school",
          tourl:'schoolManagement',//路由地址

        },
        {
          id: 6,
          title: "负责区域已开课学校总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolcountisstatus",
          tourl:'schoolManagement',//路由地址
          query:{is_status:2},
        },
        {
          id: 7,
          title: "负责区域本学期班级总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写 
          count_key: "schoolclass_num", 
          tourl:'onlineAreaPersonnel',//路由地址

        },
        {
          id: 8,
          title: "负责区域已开课班级总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclassstatus",
          tourl:'onlineAreaPersonnel',//路由地址
          query:{class_session_status:1},

        },
        {
          id: 9,
          title: "负责区域本学期正常上课节次（不包含代课）",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_session_status",
          tourl:'onlineAreaPersonnel',//路由地址
          query:{class_session_status:1,is_daike:1},
        },
        {
          id: 10,
          title: "负责区域本学期代课课节次",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_daike",
          tourl:'onlineAreaPersonnel',//路由地址
          query:{is_daike:2},
        },
        {
          id: 11,
          title: "负责区域本学期暂停一次课节次",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_pause",
          tourl:'onlineAreaPersonnel',//路由地址
          query:{is_pause:2},
        },
        {
          id: 12,
          title: "本周负责区域课程总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_week",
          tourl:'onlineAreaPersonnel',//路由地址 
        },
        {
          id: 13,
          title: "本周负责区域暂停总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_weekpause",
          tourl:'onlineAreaPersonnel',//路由地址
          query:{is_pause:2},
        },
      ],
      // 线上区域负责人
      growDatazxqy: [
        {
          id: 1,
          title: "管理线上工作人员个数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "zxguser",
          tourl:'onlineManagement',//路由地址

        },
        {
          id: 2,
          title: "负责区域本学期学校总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "school",
          tourl:'schoolManagement',//路由地址

        },
        {
          id: 3,
          title: "负责区域已开课学校总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolcountisstatus",
          tourl:'courseScheduling',//路由地址 

        },
        {
          id: 4,
          title: "负责区域本学期班级总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_num",
          tourl:'onlineAreaPersonnel',//路由地址
          query:{class_session_status:1},
        },
        {
          id: 6,
          title: "负责区域本学期正常上课节次（不包含代课）",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_session_status",
          tourl:'onlineAreaPersonnel',//路由地址
          query:{class_session_status:1,is_daike:1},
        },
        {
          id: 7,
          title: "负责区域本学期代课课节次",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_daike",
          tourl:'onlineAreaPersonnel',//路由地址
          query:{class_session_status:1,is_daike:2},
        },
        {
          id: 8,
          title: "负责区域本学期暂停一次课节次",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_pause",
          tourl:'onlineAreaPersonnel',//路由地址
          query:{is_pause:2},
        },
        {
          id: 9,
          title: "本周负责区域课程总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_week",
          tourl:'onlineAreaPersonnel',//路由地址

        },
        {
          id: 10,
          title: "本周负责区域暂停总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_weekpause",
          tourl:'onlineAreaPersonnel',//路由地址
          query:{is_pause:2},
        },
        // {
        //   id: 11,
        //   title: "本周负责区域代课总数",
        //   nums: 0, // 根据实际情况填写
        //   totalnums: 0, // 根据实际情况填写
        //   count_key:'school'
        // },
      ],
      // 在地工作人员
      growDatazdgz: [
        {
          id: 1,
          title: "负责区域本学期学校总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "school",
          tourl:'schoolManagement',//路由地址

        },
        {
          id: 2,
          title: "负责区域已开课学校总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolcountisstatus",
          tourl:'schoolManagement',//路由地址
          query:{is_status:2},


        },
        {
          id: 3,
          title: "负责区域本学期班级总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_num",
          tourl:'schoolManagement',//路由地址

        },
        {
          id: 4,
          title: "负责区域已开课班级总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclassstatus",
          tourl:'schoolManagement',//路由地址
          query:{is_status:2},

        },
        {
          id: 5,
          title: "本周负责区域课程总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_week",
          tourl:'schoolManagement',//路由地址 

        },
        {
          id: 6,
          title: "本周已督课课程总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_weekstaatus",
          tourl:'onlineAreaPersonnel',//路由地址 
          query:{class_session_status:1},

        },
        {
          id: 7,
          title: "本周已入校班级总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schooltatus",
          tourl:'schoolManagement',//路由地址 
          
        },
        {
          id: 8,
          title: "入校信息班级总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schooltatusweiwanc",
          tourl:'schoolManagement',//路由地址 

        },
      ],
      // 线上工作人员
      growDataxsgz: [
        {
          id: 1,
          title: "本周负责区域课程总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_week",
          tourl:'myAreaPersonnel',//路由地址 

        },
        {
          id: 2,
          title: "本周负责区域暂停总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_weekpause",
          tourl:'myAreaPersonnel',//路由地址 
          query:{is_pause:2},

        },
        {
          id: 3,
          title: "未完成督课或代课填写课程总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_weekpausestatus",
          tourl:'onlineAreaPersonnel',//路由地址 
          query:{is_daike:2},
        },
        {
          id: 4,
          title: "累计完成督课次数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_pausestatusduke",
          tourl:'myAreaPersonnel',//路由地址 
          query:{class_session_status:1},

        },
        {
          id: 5,
          title: "累计完成代课次数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_pausestatusdaike",
          tourl:'mydkAreaPersonnel',//路由地址 
          query:{class_session_status:1},
        },
      ],
      // 超管数据
      growDataSuperAdmin: [
        {
          id: 1,
          title: "所有区域学校总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "school",
          tourl:'schoolManagement',//路由地址 

        },
        {
          id: 2,
          title: "所有区域班级总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_num",
          tourl:'onlineAreaPersonnel',//路由地址 

        },
        {
          id: 3,
          title: "所有区域本学期正常上课节次（不包含代课）",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_session_status",
          tourl:'onlineAreaPersonnel',//路由地址 
          query:{is_daike:1},

        },
        {
          id: 4,
          title: "所有区域本学期代课课节次",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclass_daike",
          tourl:'onlineAreaPersonnel',//路由地址 
          query:{is_daike:2},

        },
        {
          id: 5,
          title: "本学期已开课学校总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclasssmum",
          tourl:'schoolManagement',//路由地址 
          query:{is_status:2},
        },
        {
          id: 6,
          title: "本学期已开课班级总数",
          nums: 0, // 根据实际情况填写
          totalnums: 0, // 根据实际情况填写
          count_key: "schoolclassstatus",
          tourl:'onlineAreaPersonnel',//路由地址 
          query:{class_session_status:1},
        },
        // {
        //   id: 7,
        //   title: "按照课程区分，每种课程的课时数（正常上课+代课，选择框选择课程）",
        //   nums: 0, // 根据实际情况填写
        //   totalnums: 0, // 根据实际情况填写
        // },
      ],

      growDataTwos: [],
      echartsData: [],

      countDatas: {}, //统计数据
    };
  },
  methods: {
     visiblehide(value) { 
      // 遮罩层关闭
      this.is_day_sor = false;
    },
    receptionData(e){
     this.jtday=e;
     this.countData();
      this.is_day_sor = false;

    },
    // 筛选点击
    tabSeleShow() {
      // 显示
      this.$refs.screenOutTab.is_prop = true;
    },
    dayjss(day, format) {
      return dayjs(day).format(format);
    },
    affixcheang(e) {
      // 吸顶状态改变
      console.log(e);
      this.is_affix = e;
    },
    getcaicount(){
      caicount().then((res) => {
        if (res.code === 1) {
          let objs = {};
          for (let key in res.data) {
            if (typeof res.data[key] == "object") objs[key] = res.data[key];
          }
          setStorage("courseObj", JSON.stringify(objs));
        }
      });
    },
    torouts(to,parm){
      console.log(to,parm,'---------parm');
      this.$router.push({
        name: to,
        query: parm
      })
    },
    getlists(is=false) {
      let vm = this;
          console.log('接口获取1')

      // if (vm.isLoading || vm.isEnd) return; // 防止重复加载
      if (vm.isLoading || vm.isEnd) {
          if(!is) return
      }

      vm.isLoading = true;
          console.log('接口获取')

      let listApis = vm.is_shools_tab ? schoolList : timetableList;
      let obj = { ...vm.formInline };
      obj.timeall=vm.$refs.screenOutTab.timesArr
      listApis(obj)
        .then((res) => {
          console.log('接口获取成功')
          if (res.code === 1) {
            vm.tableData = [...vm.tableData, ...res.data.data];
            vm.formInline.page += 1;
          } else {
            vm.$message.error(res.msg || "加载失败");
          }
          vm.isLoading = false;
          if(vm.tableData.length===res.data.total||!res.data.data.length) vm.isEnd = true;
          if(is) vm.$message.success(res.msg)
        })
        .finally(() => {
          vm.isLoading = false;
        });
    },
    handleScroll() {
      const container = this.$refs.scrollContainer;
      if (container) {
        const { scrollTop, clientHeight, scrollHeight } = container;
        if (
          scrollTop + clientHeight >= scrollHeight - 80 &&
          !this.isLoading &&
          !this.isEnd
        ) {
          this.getlists();
        }
      }
    },
    shool_tabs(va) {
      if (this.is_shools_tab != va) {
        this.tableData = [];
        this.formInline = { ...this.formInline, ...this.Twostab };
        this.is_shools_tab = va;
        this.isEnd = false;
        this.isLoading=false;
        this.getlists();
      }
    },
    shool_tabs_sele(val){
      console.log('点击确认',val)
      this.tableData = [];
        this.formInline = { ...this.formInline, ...this.Twostab };
        // this.is_shools_tab = va;
        this.getlists(val);
    },
    countData() {
      let vm = this;
      // 首页数据统计
      homecount({dateday:this.jtday}).then((res) => {
        if (res.code == 1) {
          vm.countDatas = res.data;
        }
      });
    },
    authority(groupArr = [0]) {
      // 权限筛选
      let userInfo = this.userInfo;
      // 当前权限和传来的权限组进行对比
      if (groupArr.some((item) => Number(item) === userInfo)) return true;
      return false;
    },
    // 检查屏幕尺寸
    checkScreenSize() {
      // 从 localStorage 中获取 is_h5s 的值
      this.is_h5s = getStorage("is_h5s") === "false" ? false : true;
    },
    // 初始化监听器
    initResizeListener() {
      window.addEventListener("resize", this.checkScreenSize);
    },
    // 移除监听器
    removeResizeListener() {
      window.removeEventListener("resize", this.checkScreenSize);
    },
  },
  mounted() {
    this.countData();
    this.info = JSON.parse(getStorage("userinfo"));
    console.log(this.info, "----- this.info");
    let taht=this;
    if (this.is_h5s) {
      window.addEventListener("scroll", this.handleScroll);
      if(this.authority([1])) this.growDataTwos=this.growDataSuperAdmin;
      if(this.authority([2])) this.growDataTwos=this.growData;
      if(this.authority([3])) this.growDataTwos=this.growDatazxqy;
      if(this.authority([4])) this.growDataTwos=this.growDatazdgz;
      if(this.authority([5])) this.growDataTwos=this.growDataxsgz;

      this.getcaicount();

      
      taht.$nextTick(() => {
        taht.$refs.screenOutTab.calculate();//计算时间数据
        taht.getlists(); //添加列表数据
      });
    }
    this.checkScreenSize(); // 初始化检查
    this.initResizeListener(); // 添加监听器
  },
  beforeUnmount() {
    this.removeResizeListener(); // 移除监听器
    if (this.is_h5s) window.removeEventListener("scroll", this.handleScroll);
  },
  created() {
    this.is_h5s = getStorage("is_h5s") === "false" ? false : true;
    this.userInfo = Number(JSON.parse(getStorage("groupId"))); //权限
    console.log(typeof this.is_h5s, "----2222222");
    setTimeout(() => {
      this.showloading = false;
    }, 600);
  },
};
</script>
<style lang="scss" scoped>
.lycontainerBoxs {
  background-color: #ffffff;
  padding: 15px;
  box-sizing: border-box;
}
.lycontainer {
  width: 100%;
  height: calc(100vh - 80px); //动态计算长度值
  /*overflow-x: hidden;*/
  /*overflow-y:auto;*/
}
.echarts-inner {
  margin-top: 1px;
}
::v-deep(.el-scrollbar__bar.is-horizontal) {
  // display: none;
}
.lycontainerBoxs2 {
  margin-top: 20px;
}
h3 {
  margin-bottom: 10px;
}
.indextitles {
  padding: 10px 0;
}
</style>
<style>
.t-checkbox__icon {
  color: #49b9ad !important;
}
</style>

<style lang="scss">
.tanchuangshim {
  .el-input__wrapper {
    box-shadow: 0 0 0 1px rgb(73, 185, 173) inset !important;
  }
  .el-input__wrapper:hover {
    box-shadow: 0 0 0 1px #49b9ad inset !important;
  }
  .el-message-box {
    width: 80vw;
    border-radius: 10px;
  }
  .el-message-box__title {
    font-size: 18px !important;
    font-weight: 800 !important;
    text-align: center;
  }
  .el-message-box__btns {
    display: flex;
    flex-wrap: nowrap;
    .el-button {
      width: 100%;
    }
  }
}
.loading-text {
  text-align: center;
  padding: 10px;
  font-size: 12px;
  color: #888;
}
.h5_boxs_h5s {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  .h5imgbj {
    position: absolute;
    width: 226px;
    height: 187px;
    right: 0;
    top: 0;
  }
  .h5_boxs_h5sBoxse {
    padding: 0 15px;
    position: relative;
    height: 100%;
    overflow-y: auto;
  }
  .h5Boxs_one {
    h2 {
      line-height: 25px;
      height: 17px;
      margin-top: 5px;
    }
    p {
      font-size: 12px;
      line-height: 17px;
      margin-top: 15px;
    }
  }
  .h5Boxs_twos {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    height: 70px;
    border-radius: 10px;
    border: 1px solid #ffffff;
    margin-top: 20px;
    .container {
      display: grid;
      width: 100%;
      height: 100%;
      grid-template-columns: repeat(
        3,
        1fr
      ); /* 创建三列，每列占据可用空间的1份 */
      // gap: 10px; /* 可选：添加一些间距 */
    }
    .item {
      display: flex;
      justify-content: center;
      align-content: center;
      flex-direction: column;
      text-align: center;
      margin: 0;
      box-sizing: border-box; /* 包括padding和border在内的总宽度为1fr */
      .item1 {
        font-size: 14px;
        font-weight: 400;
        color: rgba(156, 159, 167, 1);
      }
      .item2 {
        font-size: 16px;
        font-weight: 700;
        color: rgba(3, 3, 2, 1);
        margin-top: 8px;
      }
    }
  }
  .h5Boxs_threes_list {
    // background: red;
    h2 {
      font-size: 17px;
      margin: 20px 0;
      display: flex;
      align-items: center;
    }
    .h5Boxs_threes_lists_ones {
      display: grid;
      width: 100%;
      height: 100%;
      grid-template-columns: repeat(3, 1fr);
      .lists_ones_item {
        h3 {
          font-size: 30px;
          text-align: center;
          margin: 0;
          font-weight: 600;
        }
        p {
          font-size: 14px;
          text-align: center;
          margin-top: 20px;
        }
      }
    }
    .threes_lists_ones2{
      grid-template-columns: repeat(2, 1fr);
    }
  }
  .tabsJ_list_boxs {
    display: flex;
    justify-content: space-between;
    margin-top: 35px;
    margin-bottom: 10px;
    align-items: center;
    .tabsJ_list_one {
      display: flex;
      align-items: center;
      .tabsJ_list_one_item_sies {
        margin-left: 20px;
      }

      .tabsJ_list_one_item {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 14px;
        color: rgba(3, 3, 2, 0.4);
        p {
          width: 20px;
          height: 2px;
          margin-top: 5px;
        }
      }
      .one_item_2 {
        font-size: 16px;
        font-weight: 600;
        color: rgba(3, 3, 2, 1);
        p {
          width: 20px;
          height: 2px;
          background-color: rgba(73, 185, 173, 1);
          border-radius: 10px;
        }
      }
    }
    .tabs_icons {
      display: flex;
      align-items: center;
      font-size: 14px;
      color: rgba(51, 51, 51, 1);
      span {
        margin-left: 5px;
        font-size: 12px;
      }
    }
  }
  .tabsJ_affix {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    padding: 10px 10px;
    box-sizing: border-box;
    border-radius: 5px;
  }
}
.tabslistsClass {
  display: flex;
  align-items: center;
  .lists_item_boxs {
    width: 100%;
  }

  .lists_item_boxs_one {
    width: 40px !important;
    min-width: 40px;
    height: 38px;
    background-color: #49b9ad;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-radius: 5px;
    margin-right: 10px;
    div {
      font-size: 12px;
    }
    p {
      font-size: 15px;
      margin-top: 3px;
      font-weight: bold;
    }
  }
}
</style>